#include<stdio.h>
int main(){
	int time=0;
	int process=0;
	scanf("%d %d",&time,&process);
	int h=time/100;
	int m=time%100;
	m=m+process;
	while(m>=60){
		h++;
		m=m-60;
		if(h>=24) h=h-24;
	}
	while(m<0){
		h--;
		m=m+60;
		if(h<0) h=24+h;
	}
	int now=h*100+m;
	if(h>0) printf("%d",now);
	else printf("0%d",m);
	return 0;
}
